// 引入封装好的模块
import {seckList} from '../../../request/api'

const state = {
    seckList:[]
}

const getters = {
    getSeckList(state){
        return state.seckList
    }
}

const mutations = {
    REQ_SECKLIST(state,payload){
        state.seckList = payload
    }
}

const actions = {
    changeSeckListActions({commit}){
        seckList().then(res=>{
            console.log(res,'秒杀列表');
            if(res.code==200){
                let list = res.list? res.list : []
                commit('REQ_SECKLIST',list)
            }
        })
    }
}
export default {
    state,
    getters,
    mutations,
    actions,
    //命名空间
    namespaced: true,
}